<script>
import { isArray, isString } from 'is-type-data';

export default {
  name: "AegleInput",
  props: {
    schema: {
      type: Object,
      default: null,
    },
  },
  render() {
    if (this.schema) {

        const clazz = ['aegle-input']
        if(isString(this.schema.class)) {
            clazz.push(this.schema.class)
        }else if(isArray(this.schema.class)) {
            clazz = [...clazz,this.schema.class]
        }
      const Comp = (
        <el-input
          v-model={this.schema.value}
          style={{ ...this.schema.style }}
          props={{...this.schema.props}}
          placeholder={this.schema.placeholder}
          class={clazz}
        ></el-input>
      );

      return Comp;
    }
  },
};
</script>

<style lang="scss" scoped>
::v-deep .el-input__inner {
  padding: 0 8px;
  border-radius: 2px;
} 
</style>